<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Set the log file to write log messages to</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.xslt-set-error-handler.html">xslt_set_error_handler</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.xslt-set-object.html">xslt_set_object</a></div>
 <div class="up"><a href="ref.xslt.html">XSLT (PHP 4) 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.xslt-set-log" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">xslt_set_log</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.6)</p><p class="refpurpose"><span class="refname">xslt_set_log</span> &mdash; <span class="dc-title">Set the log file to write log messages to</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.xslt-set-log-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>xslt_set_log</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$xh</code></span>
   [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$log</code></span>
  ] )</div>

  <p class="para rdfs-comment">
   This function allows you to set the file in which you want <acronym title="eXtensible Stylesheet Language Transformations">XSLT</acronym> log
   messages to, <acronym title="eXtensible Stylesheet Language Transformations">XSLT</acronym> log messages are different than error messages, in
   that log messages are not actually error messages but rather messages
   related to the state of the <acronym title="eXtensible Stylesheet Language Transformations">XSLT</acronym> processor. They are useful for
   debugging <acronym title="eXtensible Stylesheet Language Transformations">XSLT</acronym>, when something goes wrong.
  </p>
  <p class="para">
   By default logging is disabled, in order to enable logging you must
   first call <span class="function"><strong>xslt_set_log()</strong></span> with a boolean parameter
   which enables logging, then if you want to set the log file to debug to,
   you must then pass it a string containing the filename.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.xslt-set-log-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    <dt>
<em><code class="parameter">
xh</code></em></dt>
<dd>
<p class="para"><acronym title="eXtensible Stylesheet Language Transformations">XSLT</acronym> 处理器连接标识符，由
<span class="function"><a href="function.xslt-create.html" class="function">xslt_create()</a></span> 创建。</p></dd>


    
     <dt>
<em><code class="parameter">log</code></em></dt>

     <dd>

      <p class="para">
       This parameter is either a boolean value which toggles logging on and
       off, or a string containing the logfile in which log errors too.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.xslt-set-log-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   没有返回值。
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.xslt-set-log-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para">请注意：
在使用 Windows 时，路径必须由 <em>file://</em> 开头。</p></p></blockquote>
 </div>


 <div class="refsect1 examples" id="refsect1-function.xslt-set-log-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-5436">
    <p><strong>Example #1 Using the <acronym title="eXtensible Stylesheet Language Transformations">XSLT</acronym> Logging features</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$xh&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">xslt_create</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">xslt_set_log</span><span style="color: #007700">(</span><span style="color: #0000BB">$xh</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">xslt_set_log</span><span style="color: #007700">(</span><span style="color: #0000BB">$xh</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">getcwd</span><span style="color: #007700">()&nbsp;.&nbsp;</span><span style="color: #DD0000">'/myfile.log'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">xslt_process</span><span style="color: #007700">(</span><span style="color: #0000BB">$xh</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'dog.xml'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'pets.xsl'</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #0000BB">$result</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">xslt_free</span><span style="color: #007700">(</span><span style="color: #0000BB">$xh</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.xslt-set-error-handler.html">xslt_set_error_handler</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.xslt-set-object.html">xslt_set_object</a></div>
 <div class="up"><a href="ref.xslt.html">XSLT (PHP 4) 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
